home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / MorphOS / Epic4_mos / share / epic / script / list < prev    next >
Encoding:
Text File  |  2002-10-28  |  481 b   |  20 lines

  1. # showlist <list of items>
  2. #
  3. # Comments:
  4. # This is apparently an intellectual exercise, as this is most certainly
  5. # not the "best" way to do this, by any modern measure.  However, it does
  6. # demonstrate that it is possible to use a counter to iterate through the
  7. # argument list in a useful manner without using recursion of any kind.
  8. #
  9. alias showlist {
  10.     @ sl.cnt = 0
  11.     while (sl.wrd = [$($sl.cnt)])
  12.     {
  13.         echo $sl.wrd
  14.         @sl.cnt++
  15.     }
  16.     ^assign -sl.cnt
  17.     ^assign -sl.wrd
  18. }
  19. #Ian Frechett
  20.